<template>
  <div class="wft-w-h-100">
    <van-slider
      v-model="vModelValue"
      :max="attrs.max"
      :min="attrs.min"
      :step="attrs.step"
      :active-color="attrs.activeColor"
      :inactive-color="attrs.inactiveColor"
    />
  </div>
</template>
<script setup lang='ts'>
import { useAttrs, useTempValue } from 'generator/hooks'
import { ref, watch } from 'vue';

const props = defineProps<{
  panelJson: TPanel
  curComp: TComp
}>()

const vModelValue = ref(30)

const attrs = useAttrs(props.curComp.attrs)

const value = useTempValue(attrs, props.curComp, props.panelJson)

watch(() => value, () => {
  vModelValue.value = value.value
}, { deep: true, immediate: true })
</script>
<style scoped>
.wft-w-h-100 {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}
</style>